<template>
	<view>
		<!-- 活动投稿 -->
		<view class="hd-bottom" v-if="gjlist!=''">
			<view class="gaojian  tp-w690" v-for="item in gjlist" :key='item.id' @click="pageJumps('/pagesSecond/strategy/strategyHdgjdetail?id=' + item.id)">
				<view class="tp-ptb0lr20 flex flex_between tp-pt20">
					<view class="tp-fz26 ellispsis1 tp-lh40">{{item.articleName}}</view>
					<!-- <image class="tp-img44" src="../static/icon/Gold.png" mode=""></image> -->
				</view>
				<view class="tp-ptb0lr20 flex flex_between " style="padding-top: 10rpx;">
					<view class="flex align_center">
						<image class="tp-img36 tp-mr10" style="border-radius: 50%;" :src="item.customerAvater" mode=""></image>
						<text class="tp-fz22 ellispsis1 tp-lh40">{{item.customerName}}</text>
					</view>
					<view class="flex align_center">
						<text class="tp-fz22 ellispsis1 tp-lh40 tp-mr10">得票数</text>
						<text class="tp-mr10" style="color:#00B4FF">{{item.voteNum}}</text>
						<uni-icons type="arrowright" size="20" color="#999999"></uni-icons>
					</view>
				</view>
				<view class="tp-ptb0lr20 tp-fz22 tp-fc999 " style="padding-top: 10rpx;">
					<text class="tp-mr10">{{item.createTime}}</text>
				</view>
			</view>
		</view>
		<view class="" style="margin: 30rpx 0 0 30rpx;" v-if="gjlist==''">
			暂无数据
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				id:'',
				gjlist:[],//稿件列表
				pageNum: 1, // 当前页码,请设置初始值
				pageSize: 10, // 每页显示数量,请设置初始值
				last_page: null, // 总页数
				showLoadMore: false, // 加载更多
				loadMoreText: "加载中...",
			};
		},
		onLoad(opt) {
			this.id = opt.id
		},
		onShow() {
			this.gaojianlist()
		},
		// 上拉触底
		onReachBottom() {
			console.log(1111)
			if (this.pageNum < this.last_page) {
				this.showLoadMore = true;
				this.pageNum++
				this.gaojianlist()
			} else {
				this.loadMoreText = "已没有更多数据!"
			}
		},
		methods:{
			//稿件的列表
			gaojianlist(){
				this.$http.get(this.$api.activityDetailPaging + '?activityId=' + this.id + '&pageNum=' + this.pageNum + '&pageSize=' +
					this.pageSize).then(res => {
					if(res.code == 200){
						res.data.result.map(item => {
							if(!item.customerAvater.startsWith('http')){
								item.customerAvater = this.$imgUrl + item.customerAvater
							}
						})
						this.gjlist = res.data.result
					}
				})
			},
		},
	}
</script>

<style lang="scss">
// 底部
.hd-bottom{
	padding-top: 1rpx;
	padding-bottom: 30rpx;
	width: 100%;
	background: #FFFFFF;
}
.common_tit-wrap {
		padding: 20rpx 0 20rpx 0;
		
	}
	.gaojian{
		height: 178rpx;
		width: 690rpx;
		background: #FFFFFF;
		box-shadow: 0rpx 0rpx 8rpx 0rpx rgba(0, 0, 0, 0.16);
		border-radius: 8rpx;
		margin-top: 30rpx;
	}
</style>
